<template>
	<view>
		<view class="top">
			<view class="left">
				当前数据
			</view>
			<view class="right">
				当前等级{{list.level_name}}
			</view>
		</view>
		<view class="all">
			<view class="body">
				<view class="left">
					<view class="top2">
						当前业绩(元)
					</view>
					<view class="bot">
						{{list.achievement}}
					</view>
				</view>
				<view class="solid">

				</view>
				<view class="left">
					<view class="top2">
						当前收入(元)
					</view>
					<view class="bot">
						{{list.income}}
					</view>
				</view>
			</view>
			<view class="center">
				<view class="header flex">
					<view class="box" v-for="(item , index) in listss" :key="index">
						{{item}}
					</view>
				</view>
				<view class="foot flex_sp">
					<view class="left">
						<view class="info" v-for="(item , index) in list.record">
							{{item.date}}
						</view>
					</view>
					<view class="right flex">
						<view class="every" v-for="(item , index) in list.record" :key="index">
							<view class="list">
								{{item.achievement}}
							</view>
							<view class="list">
								{{item.project}}
							</view>
							<view class="list">
								{{item.fare}}
							</view>
							<view class="list">
								{{item.singular}}
							</view>
						</view>
					</view>
				</view>
			</view>
			<view class="last" @click="history()">
				历史记录
			</view>
		</view>
	</view>
</template>

<script>
	export default {
		data() {
			return {
				listss: ['日期', '业绩(元)', '项目(元)', '车费(元)', '订单'],
				list:{}
			};
		},
		onLoad() {
			this.getnum()
		},
		methods: {
			//获取数据
			async getnum() {
				const res = this.$api('/business/user/statistics', 'post').then((res)=>{
					console.log(res);
					console.log(res.data.data);
					this.list = res.data.data
				}).catch((err)=>{
					console.log(err);
				})
			},
			history(){
				uni.navigateTo({
					url:'/pages/index/history/history'
				})
			}
		}
	}
</script>

<style lang="scss" scoped>
	.top {
		display: flex;
		justify-content: space-between;
		background-image: url('../../../static/index/bg3.png');
		background-size: 100%;
		background-repeat: no-repeat;
		width: 100%;
		height: 140px;
		padding: 15px;
		box-sizing: border-box;

		font-size: 15px;
		font-family: PingFang SC, PingFang SC;
		font-weight: bold;
		color: #FFFFFF;
	}

	.all {
		margin-top: -40px;
		padding: 15px;
		background-color: #f5f5f5;
		min-height: calc(100vh - 170px);

		.center {
			margin: 20px 0;
			display: flex;
			flex-direction: column;

			.header {
				flex: 1;
				background-color: #FB774B;
				padding: 10px;
				background: #FB774B;
				border-radius: 10px 10px 0px 0px;
				box-sizing: border-box;

				.box {

					box-sizing: border-box;
					border-right: 1px solid #fff;
					flex: 1;
					text-align: center;
					font-size: 12px;
					font-family: PingFang SC, PingFang SC;
					font-weight: bold;
					color: #FFFFFF;
				}
			}

			.foot {
				flex: 1;

				.left {
					box-sizing: border-box;
					background-color: rgb(253, 213, 200);
					opacity: .3;
					font-size: 12px;
					box-sizing: border-box;
					display: flex;
					flex-direction: column;
					color: #1A1A1A;

					.info {
						padding: 10px;
						font-size: 10px;
						font-family: PingFang SC, PingFang SC;
						font-weight: 400;
						flex: 1;
						margin: 5px 0;
					}
				}

				.right {
					box-sizing: border-box;
					background-color: #fff;
					flex: 1;
					height: 100%;
					display: flex;
					flex-direction: column;

					.every {
						width: 100%;
						text-align: center;
						display: flex;
						// flex-direction: column;

						.list {
							padding: 15px 0;
							flex: 1;
							border: 1px solid #eeeeee;
							// display: flex;
							// flex-direction: column;
							font-size: 10px;
							font-family: PingFang SC, PingFang SC;
							font-weight: 400;
							color: #333333;
						}
					}
				}
			}
		}

		.body {
			margin-top: -50px;
			padding: 10px;
			background: #FFFFFF;
			border-radius: 10px;
			display: flex;
			align-items: center;
			justify-content: space-between;

			.solid {
				width: 2px;
				height: 40px;
				background-color: #f5f5f5;
			}

			.left {
				flex: 1;
				text-align: center;

				.top2 {
					font-size: 12px;
					font-family: PingFang SC, PingFang SC;
					font-weight: 400;
					color: #999999;
					margin-bottom: 10px;
				}

				.bot {
					font-size: 22px;
					font-family: DINPro, DINPro;
					font-weight: 900;
					color: #333333;
				}
			}
		}

		.last{
			display: flex;
			justify-content: flex-end;

			font-size: 14px;
			font-family: PingFang SC, PingFang SC;
			font-weight: bold;
			color: #FB774B;
		}
	}
</style>